package com.cloud.feign.feign.controller;

import com.cloud.feign.feign.service.FeignService;
import com.springcoud.domain.springcouddomain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value = "/feign")
public class FeignController {
	@Autowired
	private FeignService feignService;

	@RequestMapping(value = "/hello",method = RequestMethod.GET)
	private String hello(){
		return feignService.hello();
	}


	@RequestMapping(value = "/user",method = RequestMethod.GET)
	private User hellouser(){
		User user=new User();
		user.setId("1");
		user.setName("菜菜");
		return feignService.getFeginUser(user);
	}

	@RequestMapping(value = "/name",method = RequestMethod.GET)
	private String getName(){
		return feignService.getName("菜菜");
	}

	@RequestMapping(value = "/getId",method = RequestMethod.GET)
	private String  getId(){
		String id="aaaa";
		Map map=new HashMap();
		return feignService.searchLoaning(id,map);
	}

	

}
